import Vue from "vue";
import Vuex from "vuex";
import { generateKey } from '@/service/command.js';

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
      ws: null,
      id: generateKey()
  },
  getters: {
      getWs: state=>{
        return state.ws;
      },
      getId: state=>{
        return state.id;
      },
  },
  mutations: {
      setWs(state, newWs){
        state.ws = newWs;
      }
  },
  actions: {},
  modules: {},
});
